package com.gxj.study.shopdemo;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.cjj.MaterialRefreshLayout;
import com.gxj.study.shopdemo.adapter.HWAdapter;
import com.gxj.study.shopdemo.bean.Wares;
import com.gxj.study.shopdemo.utils.Pager;
import com.gxj.study.shopdemo.widget.CnToolBar;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;

import java.util.List;

public class WareListActivity extends AppCompatActivity implements Pager.OnPageListener<Wares>,TabLayout.OnTabSelectedListener,View.OnClickListener{

    private static final String TAG = "WareListActivity";

    public static final int TAG_DEFAULT = 0;
    private static final int TAG_SALE = 1;
    private static final int TAG_PRICE = 2;

    private static final int ACTION_LIST = 1;
    private static final int ACTION_GRID = 2;

    @ViewInject(R.id.tab_layout)
    private TabLayout mTabLayout;
    @ViewInject(R.id.txt_summary)
    private TextView mTextView;
    @ViewInject(R.id.recyclerView)
    private RecyclerView mRecyclerWares;
    @ViewInject(R.id.refresh_layout)
    private MaterialRefreshLayout mRefreshLayout;
    @ViewInject(R.id.toolbar)
    private CnToolBar mToolBar;

    private int oederBy = 0;
    private long campainId = 0;

    private HWAdapter mWareAdapter;
    private Pager pager;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_warelist);
        ViewUtils.inject(this);

        initTooolBar();
        initTab();
        getData();
    }
    private void initTooolBar() {
        mToolBar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                WareListActivity.this.finish();
            }
        });
        mToolBar.setRightButtonIcon(R.drawable.icon_grid_32);
        mToolBar.getmRightButton().setTag(ACTION_LIST);

        mToolBar.setRightButtonOnClickListener(this);
    }

    public Object getData() {
        return data;
    }
    private void initTab() {

    }


    @Override
    public void load(List<Wares> datas, int totalPage, int totalCount) {

    }

    @Override
    public void refresh(List<Wares> datas, int totalPage, int totalCount) {

    }

    @Override
    public void loadMore(List<Wares> datas, int totalPage, int totalCount) {

    }

    @Override
    public void onClick(View view) {

    }

    @Override
    public void onTabSelected(TabLayout.Tab tab) {

    }

    @Override
    public void onTabUnselected(TabLayout.Tab tab) {

    }

    @Override
    public void onTabReselected(TabLayout.Tab tab) {

    }
}
